Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lsp Diagnostic colors configurable from user setup #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dhoboy
Copy link

@dhoboy dhoboy commented May 14, 2022

@navarasu I love your work on this theme!

I'd like you to merge in this Pull Request to allow users to configure the Lsp Diagnostic colors from their .vimrc or lua init files.

For example, in my .vimrc I want to do this with your theme:

let g:onedark_config = {
  ...
  \ 'diagnostics': {
  ...
   \ 'hint_color': "#56b6c2",
  \ },
\ }

To get that nice cyan to show up for me as hints. Other users may want to configure their error, hint, warn, or info colors as well.

This pull request allows that user customization with your theme!

@xeluxee
Copy link
Contributor

xeluxee commented May 15, 2022

Why not using custom highlights?
https://github.com/navarasu/onedark.nvim#customization

@dhoboy
Copy link
Author

dhoboy commented May 15, 2022

Hey @xeluxee! I do use custom highlights, they are great!

Here are the ones I have set up so far:

 \ 'highlights': {
    \ 'TSParameter': { 'fg': "#abb2bf" },
    \ 'TSProperty': { 'fg': "#abb2bf" },
    \ 'TSWarning': { 'fg': "#56b6c2" },
    \ 'scssTSType': { 'fg': "#56b6c2" },
    \ 'scssTSString': { 'fg': "#56b6c2" },
    \ 'javascriptTSConstructor': { 'fg': "#61afef" },
    \ 'javascriptTSTag': { 'fg': "#61afef" },
    \ 'javascriptTSTagDelimiter': { 'fg': "#848b98" },
    \ 'javascriptTSTagAttribute': { 'fg': "#e5c07b" },
    \ 'jsdocTSKeyword': { 'fg': "#5c6370" },
    \ 'commentTSConstant': { 'fg': "#5c6370" },
    \ 'javascriptTSOperator': { 'fg': "#c678dd" },
  \ }, 

What this pull request is for, is letting users customize the colors of the Diagnostic hints, errors, warn, and info messages that get drawn. Like the color of the "H" that gets drawn on the left and the accompanying virtual text message that gets drawn on that line.

Is there a way to customize those colors in this highlights block that I missed?

@xeluxee
Copy link
Contributor

xeluxee commented May 15, 2022

Is there a way to customize those colors in this highlights block that I missed?

You can change DiagnosticHint, DiagnosticVirtualTextHint and DiagnosticUnderlineHint attributes as any other highlight group

But I agree with you that customizing diagnostics colors should be easier to use, otherwise one should edit three highlight faces to change a single color

@dhoboy
Copy link
Author

dhoboy commented May 15, 2022

I see, thank you @xeluxee! Do you not want this PR then?

And tell me this, where can I find out all the available highlight groups? I'm new to treesitter and treesitter color themes. I was on Josh Dick's One Dark theme before I added treesitter, and I liked this theme the best of the treesitter compatible neovim One Dark themes.

I was adding my above highlight colors by placing my cursor over something I wanted to change the color of, and running :TSHighlightCapturesUnderCursor to see what it was called, and then adding my own highlight color for that in my .vimrc

Thanks for your help!

@xeluxee
Copy link
Contributor

xeluxee commented May 15, 2022

Do you not want this PR then?

I think it's a good idea but it needs better integration with setup function. What do you think @navarasu?

And tell me this, where can I find out all the available highlight groups?

If you're looking for plugin-specific highlights see their documentation or readme. If you're looking for diagnostic highlights see :h diagnostic-highlights. Otherwise use something like :TSHighlightCapturesUnderCursor or see what highlight groups are implemented by various colorschemes

@dhoboy
Copy link
Author

dhoboy commented May 16, 2022

Ok, thank you @xeluxee!

Sounds good, just let me know what to change with this or if you guys would rather change this PR yourself or what you want to do 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants